<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>门店商品管理</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(function() {
		
		var materielCode = document.getElementById("materielCode");
		//alert(materielCode[materielCode.selectedIndex].value);
		//alert($("#materielCnName").val($("#materiel_cnName_"+materielCode[materielCode.selectedIndex].value).val()));
		$("#materielCnName").val($("#materiel_cnName_"+materielCode[materielCode.selectedIndex].value).val());
		$("#materielPartsCode").val($("#materiel_partsCode_"+materielCode[materielCode.selectedIndex].value).val());
		$("#materielVenderName").val($("#materiel_venderName_"+materielCode[materielCode.selectedIndex].value).val());
	});
	
</script>


</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/sys/goodsplatformmanger/">门店商品列表</a></li>
		<li class="active"><a
			href="javascript:void(0);">门店商品详情</a></li>
	</ul>
	<br />
	<form:form id="inputForm" modelAttribute="goods"
		action="" method="post"
		class="form-horizontal">
		<sys:message content="${message}" />
		<div class="control-group">
			<label class="control-label">物料编号：</label>
			<div class="controls">
				<form:select path="materielCode" style="width:200px;"
					 class="input-xlarge required" disabled="true">
					<c:choose>
						<c:when test="${materiel != null}">
							<form:option value="${materiel.code}">${materiel.cnName}</form:option>
						</c:when>
						<c:otherwise>
							<form:option value="">请输入物料名称</form:option>
						</c:otherwise>
					</c:choose>
				</form:select>
				<div style="display: none;" id="materielHidden">
					<c:choose>
						<c:when test="${materiel != null}">
							<input type="hidden" id="materiel_cnName_${materiel.code}"
								value="${materiel.cnName}" />
							<input type="hidden" id="materiel_partsCode_${materiel.code}"
								value="${materiel.partsCode}" />
							<input type="hidden" id="materiel_venderName_${materiel.code}"
								value="${materiel.venderName}" />
						</c:when>
					</c:choose>
				</div>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">物料名称：</label>
			<div class="controls">
				<form:input path="" id="materielCnName" htmlEscape="false"
					maxlength="10" readonly="true" class="input-xlarge" />
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">配件编号：</label>
			<div class="controls">
				<form:input path="" id="materielPartsCode" htmlEscape="false"
					maxlength="10" readonly="true" class="input-xlarge" />
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">制造商品牌：</label>
			<div class="controls">
				<form:input path="" id="materielVenderName" htmlEscape="false"
					maxlength="10" readonly="true" class="input-xlarge" />
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">所属门店：</label>
			<div class="controls">
				<form:select path="storeCode" class="input-xlarge required" disabled="true">
					<option value="">所有</option>
					<form:options items="${storeList}" itemValue="code" itemLabel="cnName"/>
				</form:select>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">商品名称：</label>
			<div class="controls">
				<form:input path="cnName" htmlEscape="false" class="input-xlarge required" readonly="true"/>
				
			</div>
		</div>


		<div class="control-group">
			<label class="control-label">保底价格：</label>
			<div class="controls">
				<form:input path="minPrice" htmlEscape="false" maxlength="10"
					class="input-xlarge required isPrice" readonly="true" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">价格：</label>
			<div class="controls">
				<form:input path="price" htmlEscape="false" maxlength="10"
					class="input-xlarge required isPrice ltMinPrice ltMemberPrice" readonly="true"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">会员价：</label>
			<div class="controls">
				<form:input path="memberPrice" htmlEscape="false" maxlength="10"
					class="input-xlarge required isPrice ltMinPrice" readonly="true"/>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">商品图片：</label>
			<div class="controls" id="imageDiv" style="width: 50%;">
				<c:forEach var="bean" items="${goods.imgList}" >
					<img alt="" src="${ctx}/sys/file/getImg?filePath=${bean}" style="width:120px;height:120px;">
				</c:forEach>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">商品详情：</label>
			<div class="controls" id="detailDiv" style="width: 50%;">
				<c:forEach var="bean" items="${goods.detailImgList}" >
					<img alt="" src="${ctx}/sys/file/getImg?filePath=${bean}" style="width:120px;height:120px;">
				</c:forEach>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">售后服务：</label>
			<div class="controls" id="serviceDiv" style="width: 50%;">
				<c:forEach var="bean" items="${goods.serviceImgList}" >
					<img alt="" src="${ctx}/sys/file/getImg?filePath=${bean}" style="width:120px;height:120px;">
				</c:forEach>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">商品介绍：</label>
			<div class="controls">
				<form:textarea path="goodsIntroduce" id="goodsIntroduce" htmlEscape="false" rows="4" class="input-xxlarge " readonly="true"/>
			</div>
		</div>
		<script type="text/javascript" >
	         // Replace the <textarea id="editor1"> with a CKEditor
	         // instance, using default configuration.
	          CKEDITOR.replace( 'goodsIntroduce' ,{
            		filebrowserImageUploadUrl : "${ctx}/sys/file/uploadImage"
              });
        </script>
		<div class="form-actions">
			<input id="btnCancel" class="btn" type="button" value="返 回"
				onclick="history.go(-1)" />

		</div>
	</form:form>
</body>
</html>